package com.TT.service;

import com.TT.dao.BooksMapper;
import com.TT.pojo.Books;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BooksServiceImpl implements BooksService {

    //service调dao层
    @Autowired
    private BooksMapper booksMapper;

    public int addBooks(Books books) {
        return booksMapper.addBooks(books);
    }

    public int deleteBooksById(int id) {
        return booksMapper.deleteBooksById(id);
    }

    public int updateBooks(Books books) {
        return booksMapper.updateBooks(books);
    }

    public Books queryBooksById(int id) {
        return booksMapper.queryBooksById(id);
    }

    public List<Books> queryAllBooks() {
        return booksMapper.queryAllBooks();
    }

    public Books queryBooksByName(String bookName) {
        return booksMapper.queryBooksByName(bookName);
    }
}
